package com.example.service.impl;

import com.example.model.CargoRequest;
import com.example.service.CargoInterService;
import com.example.utils.CargRequestData;
import com.example.utils.processCargoData;

import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CargoInterServiceImpl implements CargoInterService {

    //判断货物数据是否合法
    @Override
    public Boolean verifyCargoData(List<CargoRequest> cargoRequestList) {
        for (CargoRequest cargoRequest : cargoRequestList) {
            if (!CargRequestData.isValidCargoRequest(cargoRequest)) {
                return false;
            }
        }
        return true;
    }

    @Override
    public void proCargoData(List<CargoRequest> cargoRequestList) {
        for (CargoRequest cargoRequest : cargoRequestList) {
            processCargoData.addCargoCode(cargoRequest);
        }
    }
    //货物数据处理

}
